﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 赛马
{
    class Bet
    {
        //定义三个对象分别记录每一局甲乙丙投注的筹码
        public static int chouma1;
        public static int chouma2;
        public static int chouma3;

        public struct bundle//建立一个结构体把人跟选择的马联系在一起
        {
            public Person person;
            public Horse horse;
        }

        public static void jisuan(Form1 aForm , Bet.bundle J, Bet.bundle Y, Bet.bundle B)//建立一个计算比赛结果的方法
        {
            if (aForm.pictureBox4.Left >= 686)
            {
                if (J.horse.mahao == 1)
                {
                    J.person.chouma = J.person.chouma + chouma1 * 2;
                }
                if (Y.horse.mahao == 1)
                {
                    Y.person.chouma = Y.person.chouma + chouma2 * 2;
                }
                if (B.horse.mahao == 1)
                {
                    B.person.chouma = B.person.chouma + chouma3 * 2;
                }
            }
            else if (aForm.pictureBox5.Left >= 686)
            {
                if (J.horse.mahao == 2)
                {
                    J.person.chouma = J.person.chouma + chouma1 * 2;
                }
                if (Y.horse.mahao == 2)
                {
                    Y.person.chouma = Y.person.chouma + chouma2 * 2;
                }
                if (B.horse.mahao == 2)
                {
                    B.person.chouma = B.person.chouma + chouma3 * 2;
                }
            }
            else if (aForm.pictureBox6.Left >= 686)
            {
                if (J.horse.mahao == 3)
                {
                    J.person.chouma = J.person.chouma + chouma1 * 2;
                }
                if (Y.horse.mahao == 3)
                {
                    Y.person.chouma = Y.person.chouma + chouma2 * 2;
                }
                if (B.horse.mahao == 3)
                {
                    B.person.chouma = B.person.chouma + chouma3 * 2;
                }
            }
            
            
        }
    }
}
